package com.dartfar.base.model;

import java.util.List;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.jbpm.api.identity.Group;

//角色
@Entity
@Table(name="T_Role")
public class Role implements Group {
	
	//主键
	private int roleId;
	//名称
	private String roleName;
	//代码
	private String roleCode;
	//备注
	private String roleDes;
	//人员列表
	private List<Person> persons;
	//是否是系统角色
	private boolean systemState;
	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	public int getRoleId() {
		return roleId;
	}
	public void setRoleId(int roleId) {
		this.roleId = roleId;
	}
	public String getRoleName() {
		return roleName;
	}
	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}
	public String getRoleCode() {
		return roleCode;
	}
	public void setRoleCode(String roleCode) {
		this.roleCode = roleCode;
	}
	public String getRoleDes() {
		return roleDes;
	}
	public void setRoleDes(String roleDes) {
		this.roleDes = roleDes;
	}
	@ManyToMany
	@JoinTable(name="T_Person_Role",
		joinColumns={@JoinColumn(name="roleId")},
		inverseJoinColumns={@JoinColumn(name="personId")}
		)
	public List<Person> getPersons() {
		return persons;
	}
	public void setPersons(List<Person> persons) {
		this.persons = persons;
	}
	public boolean isSystemState() {
		return systemState;
	}
	public void setSystemState(boolean systemState) {
		this.systemState = systemState;
	}
	
	@Override
	@Transient
	public String getId() {
		// TODO Auto-generated method stub
		return null;
	}
	@Override
	@Transient
	public String getName() {
		// TODO Auto-generated method stub
		return null;
	}
	@Override
	@Transient
	public String getType() {
		// TODO Auto-generated method stub
		return null;
	}

}
